<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>
<form method="POST" action="${rootURL}menu/update.html" >
			 <div  style="margin-left: 10px;margin-top: 10px;margin-bottom: 5px;">
			 
			 
					<a class="btn btn-primary" href="${rootURL}menu/add.html?rel=${param.rel}" rel="${param.rel}" target="panel" ><i class="boot_icon-plus-sign boot_icon-white"></i> 添加顶级菜单</a>
	
					<a class="btn btn-primary" href="menu/add.html?rel=${param.rel}&id=${m.id}" rel="${param.rel}" target="panel" ><i class="boot_icon-plus-sign boot_icon-white"></i> 添加下级菜单</a>
					<a class="btn btn-danger" target="ajaxTodo"  href="menu/delete.html?rel=${param.rel}&id=${m.id}" rel="${param.rel}" title="您确定删除菜单<font color='red'>[数据库管理]</font>吗？如果此菜单有下级菜单，将无法删除！"><i class="boot_icon-remove-sign boot_icon-white"></i>删除</a>
			</div>
			<div class="divider"></div>
		<table class="table table-nobordered ">
			<tr>
				<th>菜单序号：</th>
				<td>
					<input type="text" name="sort"  value="${m.sort}" required="true"  min="1" max="999" maxlength="3" />
					<span class="text-info">用于同级菜单排序，值越大越靠前(数值范围：1-999 整数)</span>
				</td>
			</tr>
			<tr>
				<th>菜单名称：</th>
				<td>
					<input type="text" name="name"  value="${m.name}" class="easyui-validatebox"  required="true"   data-options="validType:['length[1,20]']" maxlength="20" />
				</td>
			</tr>
			<tr>
				<th>菜单图片：</th>
				<td>
					<a href="${rootURL}icons.html?lookup=icon" lookupGroup="icon" target="dialog" title="菜单图标查询">
						<input type="text" maxlength="100" name="icon" readonly="readonly"  toName="icon.url"  value="${m.icon}"/>
					</a>
					<!--  
					<a class="easyui-linkbutton clearLookup"  icon="icon-cancel"	plain="true"  href="javascript:;"  clearLookup="icon"  title="清空"></a>
					-->
				</td>
			</tr>
			
			<c:if test="${pm!=null}">
				<tr>
					<th>上级菜单：</th>
					<td lookupGroup="menu">	
						<a href="${rootURL}menu/tree.html?id=${m.id}&lookup=menu&rel=${param.rel}"  title="上级菜单查询" width="500" target="dialog">
							<input type="text" readonly="readonly" class="easyui-validatebox"  required="true"  value="${pm.name}"  toName="menu.name" />
						</a>
						<input type="hidden" name="pid"  toName="menu.id"  value="${m.pid}"/>
					</td>
				</tr>
			</c:if>
			<c:if test="${pm==null}">
			
				<tr>
					<th>上级菜单：</th>
					<td lookupGroup="menu" >	
						<a href="${rootURL}menu/tree.html?id=${m.id}&lookup=menu&rel=${param.rel}"  title="上级菜单查询" width="500"  target="dialog">
							<input type="text" readonly="readonly" class="easyui-validatebox"  required="true"  value="顶级菜单"  toName="menu.name" />
						</a>
						<input type="hidden" name="pid"  toName="menu.id"  value=""/>
					</td>
				</tr>
			
			
			</c:if>
			
			
			<tr>
				<th>是否展示：</th>
				<td>
					<select  name="isOpen" sValue="${m.isOpen}">
							<option value="0">合并</option>
							<option value="1">展开</option>
					</select>
					<span class="text-info">用于树状列表，默认是否展开，显示子菜单</span>
				</td>
			</tr>
			
			
				<tr>
					<th>url：</th>
					<td>
						<input  type="text" name="url"   maxlength="255" style="width: 90%" value="${m.url}"/>
						
					</td>
				</tr>
				<tr>
					<th>target：</th>
					<td>
						<input type="text" name="target"  maxlength="10"  vaule="navTab" value="${m.target}"/>
						<span class="text-info">navTab(在标签中),dialog(弹出窗口);_blank(在浏览器新窗口)</span>
					</td>
				</tr>
				
				<tr>
					<th>rel：</th>
					<td>
						<input type="text" name="rel" maxlength="20"  value="${m.rel}"/>
						<span class="text-info">rel为打开页面所在标签或弹出窗口的id，如果重复，将在同一标签打开</span>
					</td>
				</tr>
				<tr>
				<th>是否可用：</th>
				<td>
					<select   name="isAvailable" sValue="${m.isAvailable}">
							<option value="1">可用</option>
							<option value="0">禁用</option>
					</select>
				</td>
			</tr>
			
				<tr>
				  <th></th>
				  <td>
					 <div  style="margin-top: 10px;margin-bottom: 10px;">
						  <button type="submit" class="btn btn-primary" >修改</button>&nbsp;&nbsp;&nbsp;&nbsp;
						  <button type="button" class="btn clear" >清空</button>
						
					 </div>
				  </td>
			    </tr>
		</table>
	 <input type="hidden" name="id" value="${m.id}"/>
	 <input type="hidden" name="currentCallback" value="menu/addPage.do?rel=xtgl_cdgl"/>
	 <input type="hidden" name="callback_fn" value="queryLeftMenus"/>
</form>
